jQuery(document).ready(function () {
    initPopupValid("form_sample_1");
})
function doSubmit(btn) {
    if (!$("#form_sample_1").valid()) return;
    $(btn).button('loading');//屏蔽提交按钮，防止二次提交
    $.ajax({
        type: "POST",
        data: $('#form_sample_1').serialize(),
        url: rootPath + "/userCon/ajax/changePwd",
        dataType: 'json',
        success: function (data, textStatus) {
            if (data.code == "0000") {
                commonJs.alertMsg('密码修改成功，将重新登录！',function(){
                    logout();
                });
            } else{
                commonJs.alertMsg(data.msg);
            }
            $(btn).button('reset')//释放被屏蔽的按钮
        }
    });
}

function logout() {
    window.parent.layer.closeAll();
    window.parent.location.href = rootPath + "/logout";
}